package com.lin.spbddo.server.controller;

import com.lin.spbddo.api.enums.StatusCode;
import com.lin.spbddo.api.response.BaseResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class BaseController {
    private static final Logger log = LoggerFactory.getLogger(BaseController.class);

    private static final String prefix = "base";

    @RequestMapping(value = prefix+"/one")
    public BaseResponse one(@RequestParam String params){
        BaseResponse response = new BaseResponse(StatusCode.Success);
        try {
            response.setData(params);
        }catch (Exception e){
            e.printStackTrace();
            response = new BaseResponse(StatusCode.Fail);
        }

        return response;
    }

}
